<template>
  <el-drawer :size="language == 'zh'?'40%':'50%'" v-model="editCustomsClearanceVisible" append-to-body>
    <template #header>{{ msg.title }}</template>
    <el-scrollbar height="100%">
      <el-form :model="editCustomsClearanceFromData" label-position="top" :rules="rules" ref="goodsRuleFormRef">
        <el-row :gutter="40">
          <el-col :span="12" v-for="(item, key) in editCustomsClearanceFromData">
            <el-form-item :label="item.label" :prop="`${key}.value`">
              <template v-if="item.vBind == 'v-number'">
                <el-input
                  :placeholder="msg.noModifications"
                  v-if="item.type == 'el-input'"
                  v-number:4
                  v-bind="item.attr"
                  v-model="item.value"
                ></el-input>
              </template>
              <template v-else>
                <el-input
                  :placeholder="msg.noModifications"
                  v-if="item.type == 'el-input'"
                  v-bind="item.attr"
                  v-model="item.value"
                ></el-input>
              </template>

              <el-select
                :placeholder="msg.noModifications"
                v-if="item.type == 'el-select'"
                v-bind="item.attr"
                v-model="item.value"
              >
                <el-option
                  v-for="itemOption in item.options"
                  :key="itemOption.value"
                  :label="itemOption.label"
                  :value="itemOption.value"
                ></el-option>
              </el-select>
            </el-form-item>
          </el-col>
        </el-row>
      </el-form>
    </el-scrollbar>
    <template #footer>
      <!-- <create-C></create-C> -->
      <el-button type="default" @click="editCustomsClearanceResetFn">{{ msg.cancel }}</el-button>
      <el-button type="primary" @click="editCustomsClearanceSavetFn">{{ msg.save }}</el-button>
    </template>
  </el-drawer>
</template>
<script setup lang='ts' name='editCustomsClearanceC'>
import { ref, reactive, getCurrentInstance, inject, defineComponent, h, withDirectives,resolveDirective,computed } from "vue";
import { ElInput, ElScrollbar, ElForm, ElFormItem, ElSelect, ElOption, ElButton, ElDrawer } from "element-plus";
import { Model } from "echarts";
import { expression, number } from "mathjs";
import { useGlobalStore } from "@/stores/modules/global";
const globalStore = useGlobalStore();
const language = computed(() => globalStore.language);//页面翻译语种
const editCustomsClearanceVisible = inject("editCustomsClearanceVisible");
const msg = inject("editCustomsClearanceMsg");
// const editElementNodeType = inject("editCustomsClearanceElementNodeType");
// const editQifaPropsFromConfig = inject("editCustomsClearanceFromConfig");
const editCustomsClearanceFromData = inject("editCustomsClearanceFromData");
const editCustomsClearanceResetFn = inject("editCustomsClearanceResetFn");
const editCustomsClearanceSavetFn = inject("editCustomsClearanceSavetFn");
// <el-button type="primary">Primary</el-button>
console.dir(ElInput);
console.dir(editCustomsClearanceFromData.value);




let v=resolveDirective('number')
let va = ref(3);
const createC = defineComponent({ 
  render() {
    return withDirectives(h(ElInput, {
      modelValue: va.value,
      "onUpdate:modelValue": val => {
        va.value = val;
      },
      class: "qf_input"
    }),[[v]]) ;
  }
});
</script>
<style lang='scss' scoped>
</style>
